package framework;

/**
 * This class implements CellInterface.
 * 
 */
public class CellImpl implements CellInterface {
	// row, column positions of this cell
	private int row;
	private int col;
	// cell state
	private int state;

	
	/**
	 * Returns the current state of this cell, note that state is
	 * represented by an int.
	 * 
	 * @return int state -  the current state of the cell
	 */
	@Override
	public int getState() {
		return state;
	}

	
	/**
	 * Sets the state of this cell to new state. The client must use this method
	 * to initialize states of all cells.
	 * 
	 * @param int state - the state which the cell should be set to
	 */
	@Override
	public void setState(int s) {
		state = s;
	}

	
	/**
	 * Returns the row number of this cell if board is viewed as a 2d array.
	 * 
	 * @return int row - the row of the cell
	 */
	@Override
	public int getRowNum() {
		return row;
	}

	
	/**
	 * Returns the column number of this cell if board is viewed as a 2d array.
	 * 
	 * @return int col - the column of the cell
	 */
	@Override
	public int getColNum() {
		return col;
	}

	
	/**
	 * Sets the row number of this cell to r if board is viewed as a 2d array.
	 * The client must use this method to initialize row positions of all cells
	 * on Board.
	 * 
	 * @param int r - the row number which the cell should be set to
	 */
	@Override
	public void setRowNum(int r) {
		row = r;
	}

	
	/**
	 * Sets the column number of this cell to c if board is viewed as a 2d
	 * array. The client must use this method to initialize column positions of
	 * all cells on Board.
	 * 
	 * @param int c - the column number which the cell should be set to
	 */
	@Override
	public void setColNum(int c) {
		col = c;
	}
}
